<?php 
require_once(dirname(__FILE__)."/../../libs/login/login.php");  
require_once(dirname(__FILE__)."/../../libs/dbclass/dbconnect.php");
require_once(dirname(__FILE__)."/../../libs/string/libstr.php");
require_once(dirname(__FILE__)."/../../libs/string/pager.php");
require_once(dirname(__FILE__)."/../../admin/libs/product_class.php");
$lg=new login();
$lg->checklogin("admin_member");//检验是否登录
$mc=new libstr();
$pd=new product();
$pg=new pager();




if(isset($_GET["del"])&&$_GET["del"]!="")
{
	$db->cmd("update product_content set guanlian=0 where id=".$_GET["cid"]."");
	//$mc->msg("","guanlian_class.php");
}

	function getglclassname($id){
	global $db;
	global $mc;

$sql="select ID,classname from guanlian_class where ID=".$id;

	$getrs=$db->dvstr($sql);
	return $getrs["classname"];
}


	$prs=$db->ds("select * from product_content where guanlian=".$_GET["id"]." order by id desc");
	
	



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="../css/Admin_Style.css" rel="stylesheet" type="text/css">
</head>
<style>
tr,td{border:1px solid #D6E1FB}
</style>
<script>
function GP_popupConfirmMsg(msg) { //v1.0
        	document.MM_returnValue = confirm(msg);

        }
</script>
<body>
<div >关联类别：<?php echo $tt=getglclassname($_GET["id"])?></div>
<table width="100%" >
  <tr>
    <td width="80%"><div align="center"><strong>产品名称</strong></div></td>
  
    <td width="20%"><div align="center"><strong>操作</strong></div></td>
  </tr>
  <?php
  foreach($prs as $rs){
  ?>
  <tr onMouseOver="this.style.backgroundColor='#E7FEFA';" onMouseOut="this.style.backgroundColor='';">
    <td><a href="javascript:;" target="_blank"><?php echo $rs["topicname"]?></a></td>

    <td><div align="center"><a href='?del=del&id=<?php echo $_GET["id"]?>&cid=<?php echo $rs["id"]?>&url=<?php echo $_GET["url"]?>&page=<?php echo $_GET["page"]?>' onClick="GP_popupConfirmMsg('您真的要取消关联吗？');return document.MM_returnValue">取消关联</a></div></td>
  </tr>
  <?php
  }
  ?>
   <tr>
    <td colspan="2" ><div align="center"><strong><input type="button" value="返回" onClick="location.href='<?php echo $_GET["url"]?>.php?page=<?php echo $_GET["page"]?>'"></strong></div></td>
 
  </tr>
</table>

</body>
</html>